import { createRouter, createWebHistory } from 'vue-router'
import baseRouters from '@/router/modules/base'

// 存放动态路由
export const asyncRouterList = [...baseRouters]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: () => import('@/views/login/index.vue') },
    // { path: '/login', component: () => import('@/views/login/LoginPage.vue') },

    {
      path: '/',
      redirect: '/main/index',
      component: () => import('@/views/layout/index.vue')
    },
    // { path: '/search', component: () => import('@/views/search/index.vue') },
    // { path: '/aibot', component: () => import('@/views/AIbot/index.vue') },
    // { path: '/dynamic', component: () => import('@/views/dynamic/index.vue') },
    // {
    //   path: '/learning',
    //   component: () => import('@/views/learning/index.vue')
    // },
    // { path: '/user', component: () => import('@/views/user/index.vue') },
    ...asyncRouterList
  ]
})

export const allRoutes = [...asyncRouterList]

export default router
